<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <h1>打印2月份除2和12号中的天数</h1>
</body>
<script>
    document.write('2月有28天时：');
    document.write('<br>');
    for (var i = 1; i <= 28; i++) {
        if (i != 2 && i != 12) {
            document.write(i + '&nbsp&nbsp&nbsp&nbsp');
        }
    }
    document.write('<br>');
    document.write('2月有29天时：');
    document.write('<br>');
    for (var i = 1; i <= 29; i++) {
        if (i != 2 && i != 12) {
            document.write(i + '&nbsp&nbsp&nbsp&nbsp');
        }
    }
</script>

</html>